package com.lagou.boot;

import com.lagou.client.RPCConsumer;
import com.lagou.request.RpcRequest;
import com.lagou.service.IUserService;

public class ConsumerBoot {


    public static void main(String[] args) throws InterruptedException {


        RpcRequest rpcRequest = new RpcRequest();
        rpcRequest.setRequestId("1111");
        rpcRequest.setClassName("userServiceImpl");
        rpcRequest.setMethodName("sayHello");
        rpcRequest.setParameterTypes(new Class[]{String.class});
        rpcRequest.setParameters(new Object[]{"rpcRequest"});

        //1.创建代理对象
        IUserService service = (IUserService) RPCConsumer.createNewProxy(IUserService.class);


        String result = service.comeOn(rpcRequest);
        System.out.println(result);


    }
}
